package com.example.demo.model;

/*
 * Copyright © 2020-2035 erupt.xyz All rights reserved.
 * Author: YuePeng (erupts@126.com)
 */

import javax.persistence.*;
import xyz.erupt.annotation.*;
import xyz.erupt.annotation.sub_erupt.*;
import xyz.erupt.annotation.sub_field.*;
import xyz.erupt.annotation.sub_field.sub_edit.*;
import xyz.erupt.upms.model.base.HyperModel;
import xyz.erupt.jpa.model.BaseModel;
import java.util.Set;
import java.util.Date;

@Erupt(name = "消息管理")
@Table(name = "message")
@Entity
public class Message extends BaseModel {

    @EruptField(
            views = @View(
                    title = "标题"
            ),
            edit = @Edit(
                    title = "标题",
                    type = EditType.INPUT, search = @Search, notNull = true,
                    inputType = @InputType
            )
    )
    private String tittle;

    @EruptField(
            views = @View(
                    title = "消息内容"
            ),
            edit = @Edit(
                    title = "消息内容",
                    type = EditType.HTML_EDITOR, search = @Search, notNull = true,
                    htmlEditorType = @HtmlEditorType(HtmlEditorType.Type.UEDITOR)
            )
    )
    private @Lob String content;

    @EruptField(
            views = @View(
                    title = "缩略图"
            ),
            edit = @Edit(
                    title = "缩略图",
                    type = EditType.ATTACHMENT, search = @Search, notNull = true,
                    attachmentType = @AttachmentType(type = AttachmentType.Type.IMAGE)
            )
    )
    private String picture;

    @EruptField(
            views = @View(
                    title = "发布时间"
            ),
            edit = @Edit(
                    title = "发布时间",
                    type = EditType.DATE, search = @Search, notNull = true,
                    dateType = @DateType
            )
    )
    private Date publishDate;

}